namespace EntityKit.Runtime
{
    /// <summary>
    /// 状态节点接口
    /// </summary>
    public interface IStateNode
    {
        /// <summary>
        /// 当状态机创建节点时调用
        /// </summary>
        /// <param name="machine">所属状态机</param>
        void OnCreate(StateMachine machine);
        
        /// <summary>
        /// 进入状态时调用
        /// </summary>
        void OnEnter();
        
        /// <summary>
        /// 每帧更新时调用
        /// </summary>
        void OnUpdate();
        
        /// <summary>
        /// 状态转换条件判断
        /// </summary>
        void OnReason();
        
        /// <summary>
        /// 退出状态时调用
        /// </summary>
        void OnExit();

        /// <summary>
        /// 释放时调用
        /// </summary>
        /// <param name="isCurNode">自己是否为状态机的当前节点</param>
        void OnRelease(bool isCurNode);
    }
}